<template>
  <el-container>
    <el-main>
      <el-form :model="form.model" :rules="form.rules" ref="formRef" label-width="100px">
        <el-form-item required label="审核状态" prop="status">
          <el-select
              v-model="form.model.status"
              placeholder="请选择"
          >
            <el-option label="审核通过" value="1" />
            <el-option label="驳回审核" value="0" />
          </el-select>
        </el-form-item>
        <el-form-item required label="驳回理由" prop="reason">
          <el-input  v-model="form.model.reason" type="textarea" placeholder="请输入"></el-input>
        </el-form-item>
      </el-form>
    </el-main>
    <el-footer class="sa-footer--submit">
      <el-button  v-auth="'shop.admin.category.add'" 
        @click="confirm">返回</el-button>
      <el-button  v-auth="'shop.admin.category.edit'" type="primary"
        @click="confirm">确认</el-button>
    </el-footer>
  </el-container>
</template>
<script setup>
import { onMounted, reactive, ref, unref } from 'vue';


const emit = defineEmits(['modalCallBack']);
const props = defineProps({ 
  modal: {
    type: Object,
  },
});

const form = reactive({
    model: {
      reason:null,
      status:null,

    },
    rules: {
      reason: [{ required: true, message: '请输入驳回理由', trigger: 'blur' }],
      status: [{ required: true, message: '请选择审核状态', trigger: 'blur' }],

    },
});


// 表单关闭时提交
function confirm() {
  emit('modalCallBack', {
    event: 'confirm',
    data: { uuID: props.modal.params.uuID },
  });
}


</script>

